package com.juyu.miliao.api.dao.mysql;

import com.juyu.miliao.api.domain.FindDynamicLikeInfo;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.session.SqlSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.HashMap;
import java.util.Map;

/**
 * 点赞
 * @author xuanqicheng
 */
@Repository
@Slf4j
public class FindDynamicLikeDao {
    @Autowired
    private SqlSession sqlSession;

    public FindDynamicLikeInfo selectInfoByUserIdAndFindId(FindDynamicLikeInfo findDynamicLikeInfo) {
        //log.info("查询点赞信息：[{}]",f);
        return sqlSession.selectOne("selectFindDynamicLikeByUserIdAndFindId",findDynamicLikeInfo);
    }

    public int deleteDynamicLike(FindDynamicLikeInfo findDynamicLikeInfo) {
        return sqlSession.delete("deleteFindDynamicLike",findDynamicLikeInfo);
    }

    public int addFindDynamicLike(FindDynamicLikeInfo query) {
        return sqlSession.insert("addFindDynamicLike",query);
    }

}
